-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first solution #615
base: master
Are you sure you want to change the base?
first solution #615
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
Look at the few suggestions.
src/pages/PeoplePage.tsx
Outdated
<div className="block"> | ||
<div className="columns is-desktop is-flex-direction-row-reverse"> | ||
<div className="column is-7-tablet is-narrow-desktop"> | ||
<PeopleFilters /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hide this component till you have people data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Clover247 check this comment please
<a className="is-active" href="#/people">All</a> | ||
<a className="" href="#/people?sex=m">Male</a> | ||
<a className="" href="#/people?sex=f">Female</a> | ||
{renderSexFilter(null, 'All')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something went wrong with their styles, check it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, only few minor comments🔥
src/pages/PeoplePage.tsx
Outdated
<div className="block"> | ||
<div className="columns is-desktop is-flex-direction-row-reverse"> | ||
<div className="column is-7-tablet is-narrow-desktop"> | ||
<PeopleFilters /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Clover247 check this comment please
src/pages/PeoplePage.tsx
Outdated
</p> | ||
)} | ||
|
||
{!people.length && !isLoading ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{!people.length && !isLoading ? ( | |
{!people.length ? ( |
redundant in this case
src/utils/filterPeople.tsx
Outdated
person.name.toLowerCase().includes( | ||
filters.query?.toLowerCase().trim() as string, | ||
) | ||
|| person.fatherName?.toLowerCase().includes( | ||
filters.query?.toLowerCase().trim() as string, | ||
) | ||
|| person.motherName?.toLowerCase().includes( | ||
filters.query?.toLowerCase().trim() as string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toLowerCase().includes(filters.query?.toLowerCase().trim() as string)
don't repeat yourself, let's create separated function helper for this
src/utils/sortPeople.tsx
Outdated
|
||
if (sort.sortBy) { | ||
switch (sort.sortBy) { | ||
case 'died': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please create enum
for this types and reuse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, i'm approving it🔥
DEMO LINK